/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.discount.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.discount.entity.DiscountDiscountInfo;
import com.jeesite.modules.discount.dao.DiscountDiscountInfoDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 打折信息管理Service
 * @author czp
 * @version 2018-07-08
 */
@Service
@Transactional(readOnly=true)
public class DiscountDiscountInfoService extends CrudService<DiscountDiscountInfoDao, DiscountDiscountInfo> {
	
	/**
	 * 获取单条数据
	 * @param discountDiscountInfo
	 * @return
	 */
	@Override
	public DiscountDiscountInfo get(DiscountDiscountInfo discountDiscountInfo) {
		return super.get(discountDiscountInfo);
	}
	
	/**
	 * 查询分页数据
	 * @param page 分页对象
	 * @param discountDiscountInfo
	 * @return
	 */
	@Override
	public Page<DiscountDiscountInfo> findPage(Page<DiscountDiscountInfo> page, DiscountDiscountInfo discountDiscountInfo) {
		return super.findPage(page, discountDiscountInfo);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param discountDiscountInfo
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(DiscountDiscountInfo discountDiscountInfo) {
		super.save(discountDiscountInfo);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(discountDiscountInfo.getId(), "discountDiscountInfo_image");
	}
	
	/**
	 * 更新状态
	 * @param discountDiscountInfo
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(DiscountDiscountInfo discountDiscountInfo) {
		super.updateStatus(discountDiscountInfo);
	}
	
	/**
	 * 删除数据
	 * @param discountDiscountInfo
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(DiscountDiscountInfo discountDiscountInfo) {
		super.delete(discountDiscountInfo);
	}
	
}